
function copy(val:string):boolean{
   let input =document.createElement('input')
   input.value=val
   document.body.appendChild(input)
   input.select()
   document.execCommand("copy")
   document.body.removeChild(input)
   return true
}

function newCopy(text:string){
   navigator.clipboard.writeText(text)
   .then(()=>alert('复制成功'))
   .catch((err:any)=>{
      console.log(err)
   })
}
export default copy